Virtualization technology such as Xen® and VMware® allow multiple operating systems to execute on a single host computer (Xen® is a trademark overseen by the Xen Project Advisory Board and VMware® is a registered trademark of VMware, Inc.). More specifically, two or more operating systems may execute concurrently on the host computer. The virtualization technology provides the necessary functionality to allow each of the operating systems to access (directly or indirectly) the various resources of the host computer (e.g., the processor, main memory, storage pool, network interface, etc.).
For example, a first operating system executing on the host computer may request file A from the storage pool. The request from the first operating system is received by the appropriate interface provided by the virtualization technology. The virtualization technology then performs the appropriate action to obtain file A from the storage pool and load a copy of file A into the portion of main memory allocated to the first operating system. If a second operating system subsequently requests file A, the virtualization technology subsequently obtains and stores a copy of file A into the portion of main memory allocated to the second operating system.
In such cases, two copies of the same file (i.e., file A) are present in main memory. This may result in inefficient usage of the main memory. In some cases, the virtualization technology may include functionality to remove the duplicate copies of files from the main memory (i.e., after two or more copies of a given file have been loaded into main memory). Specifically, once the two copies of file A are loaded into main memory, a determination may be made about whether the two files are the same (e.g., by calculating a checksum of the memory pages containing each copy of file A and then comparing the checksums). If two memory pages are found to be the same, the virtualization technology performs the appropriate actions to ensure that both operating systems are still able to access the remaining copy of file A in the main memory and one of the copies is removed.